<?php

namespace SpecialOperations\GameBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * SpecialOperations\GameBundle\Entity\Rafinery
 */
class Rafinery extends Building
{
    public function getOilProduction($from, $to=null){
        if(!$to){
            $to=time();
        }
        $time=$to-$from;
        return $this->getOilProductionRatio()*$time/District::TIME;
        
    }
    
    public function getOilProductionRatio(){
        return (10*($this->getLevel()+1)*$this->getWorstMultiplier()*pow(1.1, $this->getLevel()*$this->getWorstMultiplier()));
    }
    
    public function __ToString(){
        return 'Rafineria';
    }
}